package com.ciaojian.core.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.ciaojian.core.enums.business.CouponCodeOriginEnum;
import com.ciaojian.core.enums.business.CouponCodeTakeRecordTypeEnum;
import com.ciaojian.core.model.group.Save;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Null;
import java.util.Date;

/**
 * @author Atlakyn
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("d_coupon_code_take_record")
public class CouponCodeTakeRecord extends Model<CouponCodeTakeRecord> {
    @TableId(type = IdType.AUTO)
    @Null(message = "id must be null",groups = Save.class)
    private Integer id;

    @ApiModelProperty("领取人")
    private Integer userId;

    @ApiModelProperty("发型师ID")
    private Integer workerId;

    @ApiModelProperty("门店ID")
    private Integer storeId;

    @ApiModelProperty("领券类型 已过期,请使用origin")
    private CouponCodeTakeRecordTypeEnum type;

    @ApiModelProperty("券码来源")
    private CouponCodeOriginEnum origin;

    @ApiModelProperty("领取活动id")
    private Integer activityId;

    @ApiModelProperty("领取的券码")
    private String couponCode;

    @ApiModelProperty("领取的券类型")
    private Integer couponId;

    @ApiModelProperty("创建时间,即领取时间")
    @Null(message = "createTime must be null")
    private Date createTime;

    @Null(message = "updateTime must be null")
    private Date updateTime;

    public CouponCodeTakeRecord() {

    }
}
